package com.example.demo.mapper;

import com.example.demo.pojo.entity.TreeHoles;
import com.example.demo.pojo.entity.TreeHolesComment;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface TreeHolesMapper {
    List<TreeHoles> list(String content);

    @Insert("insert into tree_holes (user_id, content, comment, create_time) VALUES " +
            "(#{userId},#{content},#{comment},#{createTime})")
    void insert(TreeHoles treeHoles);

    @Select("select * from tree_holes_comment where tree_holes_id=#{id}")
    List<TreeHolesComment> getAllCommentByTreeHolesId(Long id);
}
